package com.feign;

import com.feign.impl.TestFeignImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/13 22:49
 * @since JDK 1.8
 *
 * 调用不了走这里
 */
//@Component
//public class TestFeignFallback implements FallbackFactory<TestFeign> {
//
//    @Override
//    public TestFeign create(Throwable throwable) {
//        System.out.println("微服务调用客户端出错:"+throwable.getMessage()==null?"":throwable.getMessage());
//        throwable.printStackTrace();
//        return new TestFeignImpl() {
//            @Override
//            public String hello() {
//                return "服务正在维护中";
//            }
//        };
//    }
//}
